
package com.lczyfz.campusinfo.modules.frontuser.service;


import com.lczyfz.campusinfo.common.persistence.Page;
import com.lczyfz.campusinfo.common.service.CrudService;
import com.lczyfz.campusinfo.modules.frontuser.dao.CampusinfoFrontUserDao;
import com.lczyfz.campusinfo.modules.frontuser.entity.CampusinfoFrontUser;
import com.lczyfz.campusinfo.modules.frontuser.utils.FrontUserUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 前端用户管理Service
 *
 * @author yt
 * @version 2017-10-26
 */
@Service
@Transactional(readOnly = true)
public class CampusinfoFrontUserService extends CrudService<CampusinfoFrontUserDao, CampusinfoFrontUser> {

    //TODO 根据登录名获取前端用户

    /**
     * 根据登录名获取前端用户
     */
    public CampusinfoFrontUser getFrontUserByLoginName(String loginName) {
        return FrontUserUtils.getByFrontLoginName(loginName);
    }

    public List<CampusinfoFrontUser> findList(CampusinfoFrontUser campusinfoFrontUser) {
        return super.findList(campusinfoFrontUser);
    }

    public Page<CampusinfoFrontUser> findPage(Page<CampusinfoFrontUser> page, CampusinfoFrontUser campusinfoFrontUser) {
        return super.findPage(page, campusinfoFrontUser);
    }

    @Transactional(readOnly = false)
    public void save(CampusinfoFrontUser campusinfoFrontUser) {
        super.save(campusinfoFrontUser);
    }

    @Transactional(readOnly = false)
    public void delete(CampusinfoFrontUser campusinfoFrontUser) {
        super.delete(campusinfoFrontUser);
    }

}